/**
 * Created by Administrator on 2017/9/15.
 */
$(function() {
    var diquBarChart = echarts.init(document.getElementById('diquBar'));

    var diquBarOption = {

        grid: {
            top:0,
            left:0,
            bottom:0,
            right:0,
            containLabel: true
        },
        xAxis:  {
            type: 'value',
            show:false

        },
        yAxis: {
            type: 'category',
            show:false,
            data: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],
            axisLabel:{
                show:false
            }
        },
        series: [
            {
                name: '直接访问',
                type: 'bar',
                stack: '总量',
                itemStyle:{
                    normal:{
                        color:'#e6b600'
                    }
                },
                data: [320, 302, 301, 334, 390, 320, 302, 301, 334, 390,320, 302, 301, 334, 390]
            },
            {
                name: '邮件营销',
                type: 'bar',
                stack: '总量',
                itemStyle:{
                    normal:{
                        color:'#0098d9'
                    }
                },
                data: [120, 132, 101, 134, 90, 120, 132, 101, 134, 90,120, 132, 101, 134, 90]
            },
            {
                name: '联盟广告',
                type: 'bar',
                stack: '总量',
                itemStyle:{
                    normal:{
                        color:'#c6c6c6'
                    }
                },
                data: [0,0,0,0,0,0,0, 191,0,0,220,0,0,0,0]
            }
        ]
    };
    diquBarChart.setOption(diquBarOption);
});
$(function() {
    var quyuChart = echarts.init(document.getElementById('quyu'));

    var quyuOption =option = {
        series : [
            {
                name:'面积模式',
                type:'pie',
                radius : [30, 110],
                center : ['50%', '50%'],
                roseType : 'area',
                labelLine:{
                    normal:{
                        show:false
                    }
                },
                data:[
                    {value:10},
                    {value:5},
                    {value:15},
                    {value:25},
                    {value:20},
                    {value:35},
                    {value:30},
                    {value:40}
                ]
            }
        ]};


    quyuChart.setOption(quyuOption);
});
$(function() {
    var leibieChart = echarts.init(document.getElementById('leibie'));

    var leibieOption ={
        color: ['#3398db'],
        tooltip : {
            trigger: 'axis',
            axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            top:'3%',
            bottom: '3%',
            containLabel: true
        },
        xAxis : [
            {
                type : 'category',
                data : ['地区', '地区', '地区'],
                axisTick: {
                    alignWithLabel: true
                }
            }
        ],
        yAxis : [
            {
                type : 'value'
            }
        ],
        series : [
            {name:'类别数量',
                type:'bar',
                barWidth: '60%',
                data:[10, 52, 200]
            }
        ]
    };

    leibieChart.setOption(leibieOption);
});
$('.query-select2').click(function(){
    if($('.query-option').css('display')=='none'){
    $('.query-option').show();
    }else {
        $('.query-option').hide();

    }

});
$('.check-btn').click(function(){
    if($(this).hasClass('select-actived')){
        $(this).removeClass('select-actived')
    }else {
        $(this).addClass('select-actived')
    }
});
$('.check-all').click(function(){
    $('.check-btn').addClass('select-actived')
});

$('.clear-all').click(function(){
    $('.check-btn').removeClass('select-actived')
});

$('.check-one').click(function(){
    if($(this).text()=='全部'){
    $(this).parent().find('.check-btn').addClass('select-actived');
    $(this).text('取消')
    }else if($(this).text()=='取消'){
        $(this).parent().find('.check-btn').removeClass('select-actived');
        $(this).text('全部')
    }
});
